# Title     : TODO
# Objective : TODO
# Created by: xueyj
# Created on: 2020/11/19

#render("./script.Rmd",output_file = "zz.html")
#install.packages("devtools")
#if (pandoc_available())
#  cat("pandoc", as.character(pandoc_version()), "is available!\n")
#
#if (pandoc_available("1.12.3"))
#  cat("required version of pandoc is available!\n")

#render("./script.Rmd",output_file = "zz")
#pacman::p_load(rmarkdown, jpeg, grid, ggplot2, lazyopt, magrittr, dplyr)
#
#draw <- function(jpgurl, title) {
#  mg <- readJPEG(jpgurl)
#  g <- rasterGrob(mg, interpolate = TRUE, x = unit(0.5, "npc"), y = unit(0.55, "npc"))
#  p <- ggplot()
#  (p +
#    annotation_custom(g) +
#    theme_bw() +
#    labs(title = title) +
#    theme(panel.border = element_blank(),
#          panel.grid.major = element_blank(),
#          panel.grid.minor = element_blank(),
#          legend.background = element_blank(),
#          plot.title = element_text(hjust = 0.5)
#    )
#  ) %>% return()
#}
#
#path <- "D:/tcode/testQrcode"
#setwd(path)
#
#data <- list.files(path)
#for (i in seq_along(data)) {
#  k <- strsplit(data[i], ".", T)[[1]]
#  p <- draw(paste0(k[1], ".", k[2]), k[1])
#  par("mgp")
#  plot(p)
#}
pacman::p_load(openxlsx,dplyr)
da <- "C:/Users/xueyj/Desktop/96377946_0_上策隔菌坐便圈问卷调查_18_7.xlsx" %>%
  read.xlsx()
